{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-header">编辑数据</div>
    <div class="layui-card-body">
            <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">* 用户名</label>
                <div class="layui-input-inline">
                    <input type="text" name="username" value="{$data.username|default=''}" autocomplete="off" placeholder="请输入用户名" lay-verify="required|username" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">用户名不能有特殊字符，首尾不能出现下划线，不能全为数字</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="password" value="" autocomplete="off" placeholder="请输入密码" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">长度为6-16个字符，不能包含空格</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">用户组</label>
                <div class="layui-input-inline">
                    <select name="group_id">
                        <option value="">请选择用户组</option>
                        {foreach name="authGroup" item="v"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.group_id eq $v.id"}selected="selected"{/if}>{$v.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
